home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dcpp / defs.h < prev    next >
C/C++ Source or Header  |  1997-09-09  |  3KB  |  128 lines

  1.  
  2. /*
  3.  *  DEFS.H
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  */
  9.  
  10. #include <stdarg.h>
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include <time.h>
  15. #include <fcntl.h>
  16. #include <sys/file.h>
  17. #include <lib/version.h>    /* DICE specific include */
  18.  
  19. #ifdef AMIGA
  20.  
  21. #include <lib/unix.h>
  22.  
  23. #include <exec/types.h>
  24. #include <exec/nodes.h>
  25. #include <exec/lists.h>
  26. #include <clib/exec_protos.h>
  27.  
  28. #else
  29.  
  30. #define __stkargs
  31. #include <suplib/lists.h>
  32. #include <suplib/memory.h>
  33. #include <suplib/stdlib.h>
  34. #include <suplib/string.h>
  35. #include <unistd.h>
  36.  
  37. #endif
  38.  
  39. #ifdef DEBUG
  40. #define dbprintf(fubar) if (DDebug) printf fubar
  41. #else
  42. #define dbprintf(fubar)
  43. #endif
  44.  
  45. #define Prototype   extern
  46. #define Local
  47. #define arysize(ary)    (sizeof(ary)/sizeof((ary)[0]))
  48.  
  49. typedef unsigned char    ubyte;
  50. typedef unsigned short    uword;
  51. #ifndef linux
  52. typedef unsigned long    ulong;
  53. #endif
  54.  
  55. typedef struct Node Node;
  56. typedef struct MinNode MinNode;
  57. typedef struct List List;
  58. typedef struct MinList MinList;
  59.  
  60. typedef struct Include {
  61.     struct Include *Next;
  62.     char    *FileName;
  63.     long    LineNo;
  64.     long    Level;
  65.  
  66.     long    Index;        /*    set for prev cpp by push    */
  67.     long    MaxIndex;        /*    set by cpp() before scan    */
  68.     char    *Base;        /*    set by cpp() before scan    */
  69.  
  70.     char    IsFile;        /*    vs macro replace        */
  71.     char    Reserved1;
  72.     char    Reserved2;
  73.     char    Reserved3;
  74. } Include;
  75.  
  76. typedef struct PreCompNode {
  77.     struct PreCompNode    *pn_Next;
  78.     char    *pn_HeadName;
  79.     char    *pn_OutName;
  80. } PreCompNode;
  81.  
  82. typedef struct PreCompHdr {
  83.     ulong   pc_Magic;
  84.     long    pc_CppSize;     /*    preprocessed dump file    */
  85.     long    pc_SymSize;     /*    symbol table size    */
  86.     char    pc_Version[32];
  87. } PreCompHdr;
  88.  
  89. #define PCH_MAGIC   (('d'<<24)|('I'<<16)|('c'<<8)|'E')
  90.  
  91. /*
  92.  *  Symbol Type
  93.  */
  94.  
  95. #define SF_RECURSE    0x01
  96. #define SF_STRINGIZE    0x02
  97. #define SF_SPECIAL    0x04
  98. #define SF_MACROARG    0x08    /*  macro-arg, temp enable higher-up macro IDs    */
  99. #define SF_LITERAL    0x10
  100.  
  101. typedef struct Sym {
  102.     struct Sym *Next;    /*  next in hash        */
  103.     struct Sym *Creator;/*  SF_MACROARG         */
  104.     ubyte   *SymName;
  105.     short   SymLen;
  106.     short   Type;    /*  type of symbol        */
  107.     short   NumArgs;    /*  if a macro, else -1     */
  108.     ubyte   **Args;    /*  names of args for replace    */
  109.     short   *ArgsLen;    /*  lengths of args for replace */
  110.     ubyte   *Text;    /*  contents of symbol        */
  111.     long    TextLen;
  112.     long    SymGroup;    /*  for precompiled headers    */
  113.     short   Hv;     /*  hash value            */
  114. } Sym;
  115.  
  116. #define HSIZE    1024    /*  symbol hash table        */
  117. #define HMASK    (HSIZE-1)
  118.  
  119. #define MAX_IF_LEVEL        256
  120. #define MAX_INCLUDE_LEVEL   32
  121. #define MAX_ARGS        256
  122.  
  123. #define ZA_SIZE 8192
  124.  
  125. #include "error.h"
  126. #include "protos.h"
  127.  
  128.